#ifndef __PLAYER_H__
#define __PLAYER_H__

#include "cocos2d.h"
#include "Creature.h"

using namespace cocos2d;

class Player : public Creature 
{
public:
	typedef enum {
		STATE_ATTACK,
		STATE_DEFENCE,
		NUM_OF_STATE,
	} EState;

	~Player(void);
	CREATURE_CREATE_FUNC(Player);  
	virtual bool init();
	
	bool hit(float damage);
	virtual CCRect getHitRect();
	void onUpdrade();
	void setTouchStart(float y);
	void setTouchEnd();
	void update(float dt);

protected:
	void shoot(float dt);

private:

	float d_moveSpeed;

	EState d_state;
	float d_moveMax;
	float d_moveMin;
	int d_moveDst;

	CCSprite* d_pShield;

	void moveEnd(CCNode* sender);
	void setPShieldActive(bool active);
};

#endif // __PLAYER_H__

